home *** CD-ROM | disk | FTP | other *** search
/ The Programmer Disk / The Programmer Disk (Microforum).iso / xpro / vb4 / pro7 / generapp.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-11-05  |  13.4 KB  |  350 lines

  1. VERSION 2.00
  2. Begin Form Balloon_Form 
  3.    Caption         =   "WSHELP Test"
  4.    ClientHeight    =   6510
  5.    ClientLeft      =   1035
  6.    ClientTop       =   1845
  7.    ClientWidth     =   5085
  8.    ClipControls    =   0   'False
  9.    Height          =   7200
  10.    Left            =   975
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   6510
  13.    ScaleWidth      =   5085
  14.    Top             =   1215
  15.    Width           =   5205
  16.    Begin Balloon Balloon1 
  17.       BackColor       =   &H0080FFFF&
  18.       ForeColor       =   &H000000FF&
  19.       Left            =   2520
  20.       Top             =   3360
  21.    End
  22.    Begin ComboBox Combo1 
  23.       Height          =   300
  24.       Left            =   240
  25.       TabIndex        =   15
  26.       Tag             =   "Combo1 tag text"
  27.       Text            =   "Combo1"
  28.       Top             =   2880
  29.       Width           =   2175
  30.    End
  31.    Begin CommandButton BTN_Dialog 
  32.       Caption         =   "Dialog"
  33.       Height          =   375
  34.       Left            =   240
  35.       TabIndex        =   14
  36.       Tag             =   "BTN_Dialog tag text"
  37.       Top             =   240
  38.       Width           =   1335
  39.    End
  40.    Begin OptionButton Option3 
  41.       Caption         =   "Maybe option"
  42.       Height          =   255
  43.       Left            =   1200
  44.       TabIndex        =   13
  45.       Tag             =   "Option3 tag text"
  46.       Top             =   4320
  47.       Width           =   1575
  48.    End
  49.    Begin PictureBox Picture1 
  50.       AutoSize        =   -1  'True
  51.       ClipControls    =   0   'False
  52.       Height          =   360
  53.       Left            =   360
  54.       Picture         =   GENERAPP.FRX:0000
  55.       ScaleHeight     =   330
  56.       ScaleWidth      =   360
  57.       TabIndex        =   12
  58.       Tag             =   "Picture1 tag text"
  59.       Top             =   3600
  60.       Width           =   390
  61.    End
  62.    Begin CheckBox Check2 
  63.       Caption         =   "That"
  64.       Height          =   255
  65.       Left            =   1200
  66.       TabIndex        =   11
  67.       Tag             =   "Check2 tag text"
  68.       Top             =   3840
  69.       Width           =   1200
  70.    End
  71.    Begin CheckBox Check1 
  72.       Caption         =   "This"
  73.       Height          =   255
  74.       Left            =   1200
  75.       TabIndex        =   10
  76.       Tag             =   "Check1 tag text"
  77.       Top             =   3360
  78.       Width           =   1200
  79.    End
  80.    Begin Frame Frame1 
  81.       Caption         =   "Do it now"
  82.       Height          =   1215
  83.       Left            =   3000
  84.       TabIndex        =   7
  85.       Tag             =   "Frame1 tag text"
  86.       Top             =   3120
  87.       Width           =   1695
  88.       Begin OptionButton Option2 
  89.          Caption         =   "No"
  90.          Height          =   255
  91.          Left            =   240
  92.          TabIndex        =   9
  93.          Tag             =   "Option2 tag text"
  94.          Top             =   720
  95.          Width           =   1000
  96.       End
  97.       Begin OptionButton Option1 
  98.          Caption         =   "Yes"
  99.          Height          =   255
  100.          Left            =   240
  101.          TabIndex        =   8
  102.          Tag             =   "Option1 tag text"
  103.          Top             =   360
  104.          Width           =   1000
  105.       End
  106.    End
  107.    Begin TextBox TXT_Result 
  108.       Height          =   1575
  109.       Left            =   120
  110.       MultiLine       =   -1  'True
  111.       TabIndex        =   6
  112.       Tag             =   "TXT_Result tag text"
  113.       Text            =   "Status output"
  114.       Top             =   4800
  115.       Width           =   4815
  116.    End
  117.    Begin TextBox TXT_KeyString 
  118.       Height          =   375
  119.       Left            =   120
  120.       TabIndex        =   3
  121.       Tag             =   "TXT_KeyString tag text."
  122.       Text            =   "This is a popup message to display in the window. The message can be of long length, or it can be short."
  123.       Top             =   1440
  124.       Width           =   4815
  125.    End
  126.    Begin CommandButton BTN_Exit 
  127.       Caption         =   "Exit"
  128.       Height          =   375
  129.       Left            =   3480
  130.       TabIndex        =   2
  131.       Tag             =   "BTN_Exit tag text"
  132.       Top             =   240
  133.       Width           =   1455
  134.    End
  135.    Begin TextBox TXT_SearchString 
  136.       Height          =   375
  137.       Left            =   120
  138.       TabIndex        =   1
  139.       Tag             =   "TXT_SearchString tag text"
  140.       Text            =   "Dawg"
  141.       Top             =   2280
  142.       Width           =   4815
  143.    End
  144.    Begin CommandButton Btn_HelpSession 
  145.       Caption         =   "Help Balloons"
  146.       Height          =   375
  147.       Left            =   1800
  148.       TabIndex        =   0
  149.       Tag             =   "Btn_HelpSession tag text"
  150.       Top             =   240
  151.       Width           =   1455
  152.    End
  153.    Begin Label Label3 
  154.       Alignment       =   2  'Center
  155.       Caption         =   "Search String"
  156.       Height          =   255
  157.       Left            =   120
  158.       TabIndex        =   5
  159.       Top             =   1920
  160.       Width           =   4815
  161.    End
  162.    Begin Label Label1 
  163.       Alignment       =   2  'Center
  164.       Caption         =   "Key String"
  165.       Height          =   255
  166.       Left            =   120
  167.       TabIndex        =   4
  168.       Top             =   1080
  169.       Width           =   4815
  170.    End
  171.    Begin Menu nmu_File 
  172.       Caption         =   "&File"
  173.       Begin Menu mnu_Exit 
  174.          Caption         =   "&Exit"
  175.       End
  176.    End
  177.    Begin Menu mnu_Edit 
  178.       Caption         =   "&Edit"
  179.       Begin Menu mnu_Cut 
  180.          Caption         =   "Cu&t"
  181.       End
  182.       Begin Menu mnu_Copy 
  183.          Caption         =   "&Copy"
  184.       End
  185.       Begin Menu mnu_Paste 
  186.          Caption         =   "&Paste"
  187.       End
  188.       Begin Menu mnu_submenu 
  189.          Caption         =   "SubMenu"
  190.          Begin Menu mnu_submenu1 
  191.             Caption         =   "SubMenu 1"
  192.          End
  193.          Begin Menu mnu_submenu2 
  194.             Caption         =   "SubMenu 2"
  195.          End
  196.       End
  197.    End
  198.    Begin Menu mnu_help 
  199.       Caption         =   "&Help"
  200.       Begin Menu mnu_HelpBalloons 
  201.          Caption         =   "Help &Balloons"
  202.       End
  203.    End
  204. Option Explicit
  205. ' Declare statements for utility functions included in BALLOON.VBX
  206. Declare Function Hwnd2ControlTabIndex Lib "BALLOON.VBX" (ByVal hwndControl%) As Integer
  207. Declare Function Hwnd2CtlName Lib "BALLOON.VBX" (ByVal hwndControl%) As String
  208. Declare Function Hwnd2HelpContextID Lib "BALLOON.VBX" (ByVal hwndControl%) As Long
  209. Declare Function Hwnd2TagText Lib "BALLOON.VBX" (ByVal hwndControl%) As String
  210. Sub Balloon1_BalloonClick (hwndAtMouse As Integer)
  211. ' PURPOSE:  hwndAtMouse is the control the mouse is over
  212. ' COMMENTS: pass back the help text
  213. '           shows how to programmatcially end a session
  214. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  215. Dim Msg As String
  216. Dim CRLF As String
  217. Dim TestText As String
  218.     CRLF = Chr$(13) + Chr$(10)
  219.     TestText = "Use the balloon utility functions to retrieve other control properties. Display these properties in the ballon if desired." + CRLF
  220.     TestText = TestText + "CtlName = " + Hwnd2CtlName(hwndAtMouse) + CRLF
  221.     TestText = TestText + "Tag text = " + Hwnd2TagText(hwndAtMouse) + CRLF
  222.     TestText = TestText + "HelpContextID = " + Str$(Hwnd2HelpContextID(hwndAtMouse)) + CRLF
  223.     TestText = TestText + "ControlTabIndex = " + Str$(Hwnd2ControlTabIndex(hwndAtMouse))
  224.     TXT_Result.Text = TestText
  225.     Select Case hwndAtMouse
  226.         Case Me.hWnd
  227.             Exit Sub    ' do nothing
  228.         Case BTN_Dialog.hWnd
  229.             'TestText = Hwnd2TagText$(hwndAtMouse)
  230.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  231.             
  232.             ' set font and back colors dynamically
  233.             Balloon1.ForeColor = QBColor(0)
  234.             Balloon1.BackColor = QBColor(2)
  235.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control BTN_Dialog."
  236.         Case Btn_HelpSession.hWnd
  237.             'TestText = Hwnd2TagText$(hwndAtMouse)
  238.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  239.             
  240.             ' set font and back colors dynamically
  241.             Balloon1.ForeColor = &HFF0000    ' blue
  242.             Balloon1.BackColor = &HC0C0C0    ' light grey
  243.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Btn_HelpSession."
  244.         Case BTN_Exit.hWnd
  245.             'TestText = Hwnd2TagText$(hwndAtMouse)
  246.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  247.             
  248.             ' set font and back colors dynamically
  249.             Balloon1.ForeColor = QBColor(4)
  250.             Balloon1.BackColor = QBColor(14)
  251.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control BTN_Exit."
  252.         Case TXT_KeyString.hWnd
  253.             'TestText = Hwnd2TagText$(hwndAtMouse)
  254.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  255.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_KeyString."
  256.         Case TXT_SearchString.hWnd
  257.             'TestText = Hwnd2TagText$(hwndAtMouse)
  258.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  259.             
  260.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_SearchString."
  261.         Case TXT_Result.hWnd
  262.             'TestText = Hwnd2TagText$(hwndAtMouse)
  263.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  264.             
  265.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_Result."
  266.         Case Picture1.hWnd
  267.             'TestText = Hwnd2TagText$(hwndAtMouse)
  268.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  269.             
  270.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Picture1."
  271.         Case Check1.hWnd
  272.             'TestText = Hwnd2TagText$(hwndAtMouse)
  273.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  274.             
  275.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Check1."
  276.         Case Check2.hWnd
  277.             'TestText = Hwnd2TagText$(hwndAtMouse)
  278.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  279.             
  280.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Check2."
  281.         Case Frame1.hWnd
  282.             'TestText = Hwnd2TagText$(hwndAtMouse)
  283.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  284.             
  285.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Frame1."
  286.         Case Option1.hWnd
  287.             'TestText = Hwnd2TagText$(hwndAtMouse)
  288.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  289.             
  290.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option1."
  291.         Case Option2.hWnd
  292.             'TestText = Hwnd2TagText$(hwndAtMouse)
  293.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  294.             
  295.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option2."
  296.         Case Option3.hWnd
  297.             'TestText = Hwnd2TagText$(hwndAtMouse)
  298.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  299.             
  300.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option3."
  301.         Case Combo1.hWnd
  302.             'TestText = Hwnd2TagText$(hwndAtMouse)
  303.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  304.             
  305.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Combo1."
  306.         Case Else
  307.         
  308.         End Select
  309.         
  310. End Sub
  311. Sub BTN_Dialog_Click ()
  312.     Dialog.Show
  313. End Sub
  314. Sub BTN_Exit_Click ()
  315.     mnu_Exit_Click
  316. End Sub
  317. Sub Btn_HelpSession_Click ()
  318.     ' initial help text string
  319.     ' here we get the text from the on screen text box
  320.     '
  321.     ' Initial text can be left blank, if blank then
  322.     ' Balloon.vbx control will display an internal init message
  323.     Balloon1.MessageText = TXT_KeyString.Text
  324.     Balloon1.Action = 20     ' Balloon_START = 20
  325. End Sub
  326. Sub Form_Load ()
  327.     If Me.windowstate = 0 Then
  328.         Me.Top = 0
  329.         Me.Left = 0
  330.     End If
  331. End Sub
  332. Sub Form_Resize ()
  333.     If Me.windowstate = 0 Then
  334.         Me.Height = 7200
  335.         Me.Width = 5175
  336.     End If
  337. End Sub
  338. Sub mnu_Exit_Click ()
  339.     End
  340. End Sub
  341. Sub mnu_HelpBalloons_Click ()
  342.     ' initial help text string
  343.     ' here we get the text from the on screen text box
  344.     '
  345.     ' Initial text can be left blank, if blank then
  346.     ' Balloon.vbx control will display an internal init message
  347.     Balloon1.MessageText = TXT_KeyString.Text
  348.     Balloon1.Action = 20     ' Balloon_START = 20
  349. End Sub
  350.